﻿namespace PAR.Audio
{
    using System;
    using System.Windows.Controls;
    using System.Windows.Threading;

    public partial class LockScreen : UserControl
    {
        readonly DispatcherTimer _clockTimer;
        public LockScreen()
        {
            InitializeComponent();

            timeTextBlock.Text = DateTime.Now.ToString("hh:mm tt");
            dayTextBlock.Text = DateTime.Now.ToString("dddd");
            dateTextBlock.Text = DateTime.Now.ToString("MMMM dd");


            _clockTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
            _clockTimer.Tick += new EventHandler(_clockTimer_Tick);
            _clockTimer.Start();

        }

        void _clockTimer_Tick(object sender, EventArgs e)
        {
            timeTextBlock.Text = DateTime.Now.ToString("hh:mm tt");
            dayTextBlock.Text = DateTime.Now.ToString("dddd");
            dateTextBlock.Text = DateTime.Now.ToString("MMMM dd");
        }
    }
}
